package com.txzt.gaea.provide.enums;

public enum FileTypeEnum {
    DOC("doc", 1),
    PDF("pdf", 2),
    DOCX("docx", 3),
    UNKNONE("unknown", 100);

    /**
     * 编码
     */
    String code;

    /**
     * 值
     */
    int value;

    FileTypeEnum(String code, int value) {
        this.code = code;
        this.value = value;
    }

    public String getCode() {
        return code;
    }

    public int getValue() {
        return value;
    }
    public static FileTypeEnum getByCode(String code) {
        for (FileTypeEnum item : FileTypeEnum.values()) {
            if (item.getCode().equalsIgnoreCase(code)) return item;
        }
        return FileTypeEnum.UNKNONE;
    }
}
